QuickTime 4 API Documentation

Inside Macintosh: More Macintosh Toolbox

Previous | Chapter Top | Chapter Contents | Next |

Closing a Connection to a Component

When you finish using a component, you must close your connection to that component. Use the CloseComponent function to close the connection. For example, this code calls the application-defined procedure MyDrawAnOval (see Listing 4 ), which opens a connection to a drawing component and uses that component to draw an oval. This code closes the oval drawer component after it is finished using it.

VAR
    aDrawOvalComp: ComponentInstance;
    result:             OSErr;

MyDrawAnOval(aDrawOvalComp);                {open component and draw an oval}
result := DrawerErase(aDrawOvalComp);               {erase the oval}
result := CloseComponent(aDrawOvalComp); {close the component}

© 1999 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next